<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
	<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
    <h4>测试微信中转请求，已经如何禁止中转</h4>
    <form action="{:url('transpond')}" method="post" id="form">
        <div>
            <label for="sleep">等待时间</label>
            <input type="number" name="sleep" id="sleep">
        </div>
        <div>
            <label for="status">返回码</label>
            <input type="number" name="status" id="status">
        </div>
        <div>
            <label for="transpond">中转时的返回码</label>
            <input type="number" name="transpond" id="transpond" value="403">
        </div>
        <div>
            <label for="connect_redirect">直连</label>
            <input type="checkbox" name="connect_redirect" id="connect_redirect" value="1">
        </div>
        <button type="submit">访问页面</button>
        <button type="button" onclick="ajax_get()">AJAX GET 访问</button>
        <button type="button" onclick="ajax_post()">AJAX POST 访问</button>
    </form>
    <script>
        var url = "http://106.14.18.156:808/{:url('transpond')}";
        function ajax_get(){
            var params = $("#form").serialize();
            $.ajax({
                "url":url,
                "data":params,
                "success":function(data){
                    console.log(data);
                    alert(data);
                },
                "error":function(request,message){
                    console.log(request);
                    alert(request.status+":"+request.statusText);
                }
            });
        }
        function ajax_post(){
            var params = $("#form").serialize();
            $.post(url, params, function(data){
                console.log(data);
                alert(data);
            })
        }
    </script>
</body>
</html>
